#ifndef _GFX_H_
#define _GFX_H_

#include "types.h"

struct gfx_context {
	uint active_offset;
	uint line_size;         // offset to next scan line
	uint page_size;         // offset to a page
	uint font_seg;
	uint font_offs;
};

extern void gfx_setmode(uchar mode);
extern void gfx_init320x240(struct gfx_context *context);
extern void gfx_init400x300(struct gfx_context *context);
extern void gfx_clearpage(uchar color, struct gfx_context *context);
extern void gfx_setpage(uint page, struct gfx_context *context);
extern void gfx_showpage(uint page, struct gfx_context *context);
extern void gfx_setpixel(uint x, uint y, uchar color, struct gfx_context *context);
extern void gfx_setpixel4(uint x, uint y, uchar color, struct gfx_context *context);
extern uchar gfx_getpixel(uint x, uint y, struct gfx_context *context);
extern void gfx_setpalette(uchar index, uchar r, uchar g, uchar b);
extern void gfx_getpalette(uchar index, uchar *r, uchar *g, uchar *b);
extern void gfx_print_string(uint x, uint y, uint color, char *str, struct gfx_context *context);
extern void gfx_close();

#endif
